<#include "../common/head.ftl">
<!--contaniner-->
<div id="box">
 
 <!--boxleft-->
 <div class="boxleft">
  <ul>
   <li>
   <#if enterpriseInit[0].ent_status=="0">
   <a href="javascript:void(0)" onclick="correctEmergent()">急招</a>
   <#else>
   <a href="javascript:void(0)" onclick="erroremergentMsg();">急招</a>
   </#if>
   </li>
   <li><a href="${base}/postoffice">发布职位</a></li>
   <li class="currentjob"><a href="${base}/ownjob" style="color:#0089e9;">我的职位</a></li>
  </ul>
 </div>
 <!--/.boxleft-->
 
  <!--boxright-->
  
 <div class="boxright">
   
   <!--7-1info-->
   <div class="jobname">
   <#if jobresume??>
   <#list jobresume as jse>
    <a href="#">${jse.title}</a> 收到的简历
    <#assign jid=jse.id/>
    <#assign emergent=jse.emergent/>
    <#assign title=jse.title/>
   </#list>
   </#if>
   </div>
   <!--/.7-1info-->
 	<div id="content">
 	<!--tabcon-->     
    
 	</div>
    
     <!--/.tabcon-->

 </div>
 <!--boxright-->


 <!--清浮动-->
 <div style="clear:both"></div>

</div>
<!--/.contaniner-->
    

<!--footer-->
<#include "../common/bottom.ftl">
<!--/.footer--> 


<!--js-->

<!--加边框鼠标事件-->
 <script type="text/javascript">
 	$(function(){
 		effective_job_list(1);
 	});
 	
    function ShowBorder(studentinfotip){
    	studentinfotip.style.border = "solid 1px #0089e9";
    };
    function HideBorder(studentinfotip){
    	studentinfotip.style.border = "solid 1px #e5e5e5";
    };
    
  	//职位收到的简历
	function effective_job_list(page){
		var reqURL="${base}/emergent/resume";
		$.getJSON(reqURL,{
			'positionID' : '${jid}',
			'emergent' : '0',
			'pageNO' : page
		},function(data){
			if(data.result > 0){
				$("#content").empty();
				$(data.data).each(function(){
					var em = "";
					var img = "";
					if(parseInt(this.internships)>0){//判断是否有经验
						em = "<p class='img_circle12'> 有工作经验</p>";
					}
					if(this.head_img != ""&& this.head_img != "(null)" ){//判断图像是否存在
						img = "<img src='"+this.head_img+"' onerror='nofind();' alt='用户头像' class='uertxhave'/>"
					}else{
						img = "<img src='${base}/resources/images/usertx.png' alt='用户头像' class='uertxhave'/>";
					}
					if(this.title.length>10){
						tittemp = this.title.substring(0,10);
					}else{
						tittemp = this.title;
					}
					var sal_tmp="";
					if(this.salary=="20001-60000"){
						sal_tmp="20001以上";
					}else if(this.salary=="1000-20000"){
						sal_tmp="面议";
					}else{
						sal_tmp = this.salary;
					}
					$div=$("<div class='studentinfotip7' onmouseover='ShowBorder(this)' onmouseout='HideBorder(this)'>"
				      +"<a href='${base}/resume/r-"+this.stu_resume_id+".html?internships="+this.internships+"'><p>"
				      +"<span class='renewtip7'>应聘："+tittemp+"</span>"
				      +"<span class='renew7 pt30'><em>"+this.add_time+"</em></span>"
				      +"</p>"
				      +"<span class='studentinfotip7_l'>"
				      +"<p class='pt30'>"+this.full_name+"    "+this.sex+"    "+this.title+"</p>"
				      +"<p>"+this.birthday+"    "+this.certificate_type+"    "+sal_tmp+"    "+this.employment_type+"</p>"
				      +"<p>"+this.major_name+"    "+this.school_name+"</p>"
				      +"</span></a>"
				      +"<span class='studentinfo7_r_have2'>"+ img+ em +"</span></div>");
					$("#content").append($div);
				})
				if(data.page>1){
					var prew=data.page-1;
					$("#content").append("<button type='submit' class='pagebtn pagebtnother prew' onclick='effective_job_list(\""+prew+"\")'>上一页</button>");
				}else{
					$("#content").append("<button type='submit' class='pagebtn'>上一页</button>");
				}
				if(data.result<20){
					$("#content").append("<button type='submit' class='pagebtn'>下一页</button>");
				}else{
					var next=data.page+1;
					$("#content").append("<button type='submit' class='pagebtn pagebtnother next' onclick='effective_job_list(\""+next+"\")'>下一页</button>");
				}
			}else{
				$("#content").empty();
				$("#content").append("<p>"+data.message+"</p>");
			}
		});
	}
  	
	function erroremergentMsg(){
		layer.alert("企业未设置急招职位", {icon: 7,skin: 'layer-ext-moon'});
	}
	
	//图片不存在处理
	function nofind(){
		var img=event.srcElement;
		img.src="${base}/resources/images/usertx.png";
		img.onerror=null; 
	}
	
	function correctEmergent(){
		var reqURL="${base}/checkEme";
		$.post(reqURL,function(data){
			if(data.success){
				location.href="${base}/emergent";
			}else{
				layer.alert("企业未设置急招职位", {icon: 7,skin: 'layer-ext-moon'});
			}
		});
	}
	
 </script>
<!--/.加边框鼠标事件-->

<!--/.js-->

</body>
</html>